package com.one.oa.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.one.oa.dto.UserDetailDto;
import com.one.oa.entity.UserDetail;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;


public interface UserDetailDao extends BaseMapper<UserDetail> {

    @Update("update t_user_detail set imgurl=#{img} where id=#{id}")
    int updateImg(@Param("img") String img,@Param("id") int id);


    @Select("select ud.*,u.username,u.phone from t_user_detail ud inner join t_user u on ud.uid=u.id where ud.uid=#{uid}")
    @ResultType(UserDetailDto.class)
    UserDetailDto selectByUid(int uid);
}
